package com.mybatisplus.mp.path;

import org.junit.jupiter.api.Test;
import org.springframework.boot.test.context.SpringBootTest;

import java.io.*;

/**
 * 获取resource下的资源
 */
@SpringBootTest
public class GetPath {
    @Test
    public void test() throws IOException {

//        ClassPathResource classPathResource = new ClassPathResource("static/aaa.txt");
        File file = new File("bbb.txt");
        InputStream inStream = new FileInputStream(file);
        ByteArrayOutputStream outSteam = new ByteArrayOutputStream();
        byte[] buffer = new byte[1024];
        int len = -1;
        while ((len = inStream.read(buffer)) != -1) {
            outSteam.write(buffer, 0, len);
        }
        outSteam.close();
        inStream.close();
    }


}
